package com.example.demo.service;

import com.example.demo.dao.MemberMapper;
import com.example.demo.pojo.Member;

import javax.annotation.Resource;

@org.springframework.stereotype.Service
public class MemberService implements Service {
    @Resource
private MemberMapper memberMapper;
    @Override
    public Member findMember(String name, String password) {
        Member member = memberMapper.findMember(name, password);
        return member;
    }

    @Override
    public boolean insertMember(Member member) {
        int insert = memberMapper.insert(member);
     if (insert>0){
         return true;
     }else {
         return  false;
     }
    }

    @Override
    public boolean isHaveMember(String name) {
        Member haveMember = memberMapper.isHaveMember(name);
        if (haveMember!=null){
            return  true;
        }else {
            return  false;
        }

    }
}
